package dq.study.designmodel.strategy;

/**
 * @author dongqun
 * @Description: 策略实现3
 * @date 2019/4/10 21:33
 */
public class WeightComartor implements Compartor<Cat> {

    @Override
    public int compare(Cat t1, Cat t2) {
        if (t1.getWeight()>t2.getWeight()){
            return 1;
        }else if (t1.getWeight()<t2.getWeight()){
            return -1;
        }
        return 0;
    }
}
